---
category: Validator
contributors:
    - tugsanunlu
created: '2020-05-07'
title: Check if a number is positive
updated: '2021-10-13'
---

**JavaScript version**

```js isPositive.js
const isPositive = (n) => Math.sign(n) === 1;
```

**TypeScript version**

```ts isPositive.ts
const isPositive = (n: number): boolean => Math.sign(n) === 1;
```

**Examples**

```js examples.js
isPositive(3); // true
isPositive(-8); // false
```
